Optimal. Leaf size=357 \[ \frac {\left (c^5+5 i c^4 d-10 c^3 d^2-10 i c^2 d^3-35 c d^4+25 i d^5\right ) x}{8 a^3 (c-i d)^2 (c+i d)^5}+\frac {(5 c-3 i d) d^4 \log (c \cos (e+f x)+d \sin (e+f x))}{a^3 (i c-d)^5 (c-i d)^2 f}+\frac {d \left (c^3+5 i c^2 d-11 c d^2+25 i d^3\right )}{8 a^3 (c-i d) (c+i d)^4 f (c+d \tan (e+f x))}-\frac {1}{6 (i c-d) f (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))}+\frac {3 i c-11 d}{24 a (c+i d)^2 f (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))}+\frac {c^2+5 i c d-12 d^2}{8 (i c-d)^3 f \left (a^3+i a^3 \tan (e+f x)\right ) (c+d \tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.64, antiderivative size = 357, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.179, Rules used = {3640, 3677,
3610, 3612, 3611} \begin {gather*} \frac {c^2+5 i c d-12 d^2}{8 f (-d+i c)^3 \left (a^3+i a^3 \tan (e+f x)\right ) (c+d \tan (e+f x))}+\frac {d \left (c^3+5 i c^2 d-11 c d^2+25 i d^3\right )}{8 a^3 f (c-i d) (c+i d)^4 (c+d \tan (e+f x))}+\frac {x \left (c^5+5 i c^4 d-10 c^3 d^2-10 i c^2 d^3-35 c d^4+25 i d^5\right )}{8 a^3 (c-i d)^2 (c+i d)^5}+\frac {d^4 (5 c-3 i d) \log (c \cos (e+f x)+d \sin (e+f x))}{a^3 f (-d+i c)^5 (c-i d)^2}+\frac {-11 d+3 i c}{24 a f (c+i d)^2 (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))}-\frac {1}{6 f (-d+i c) (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3610
Rule 3611
Rule 3612
Rule 3640
Rule 3677
Rubi steps
\begin {align*} \int \frac {1}{(a+i a \tan (e+f x))^3 (c+d \tan (e+f x))^2} \, dx &=-\frac {1}{6 (i c-d) f (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))}-\frac {\int \frac {-a (3 i c-7 d)-4 i a d \tan (e+f x)}{(a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2} \, dx}{6 a^2 (i c-d)}\\ &=-\frac {1}{6 (i c-d) f (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))}+\frac {3 i c-11 d}{24 a (c+i d)^2 f (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))}-\frac {\int \frac {-3 a^2 \left (2 c^2+7 i c d-13 d^2\right )-3 a^2 (3 c+11 i d) d \tan (e+f x)}{(a+i a \tan (e+f x)) (c+d \tan (e+f x))^2} \, dx}{24 a^4 (c+i d)^2}\\ &=-\frac {1}{6 (i c-d) f (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))}+\frac {3 i c-11 d}{24 a (c+i d)^2 f (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))}+\frac {c^2+5 i c d-12 d^2}{8 (i c-d)^3 f \left (a^3+i a^3 \tan (e+f x)\right ) (c+d \tan (e+f x))}-\frac {\int \frac {6 a^3 \left (i c^3-5 c^2 d-13 i c d^2+25 d^3\right )+12 a^3 d \left (i c^2-5 c d-12 i d^2\right ) \tan (e+f x)}{(c+d \tan (e+f x))^2} \, dx}{48 a^6 (i c-d)^3}\\ &=\frac {d \left (c^3+5 i c^2 d-11 c d^2+25 i d^3\right )}{8 a^3 (c-i d) (c+i d)^4 f (c+d \tan (e+f x))}-\frac {1}{6 (i c-d) f (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))}+\frac {3 i c-11 d}{24 a (c+i d)^2 f (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))}+\frac {c^2+5 i c d-12 d^2}{8 (i c-d)^3 f \left (a^3+i a^3 \tan (e+f x)\right ) (c+d \tan (e+f x))}-\frac {\int \frac {-6 a^3 \left (5 c^3 d-i \left (c^4-11 c^2 d^2-15 i c d^3-24 d^4\right )\right )-6 a^3 d \left (5 c^2 d-i \left (c^3-11 c d^2+25 i d^3\right )\right ) \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{48 a^6 (i c-d)^3 \left (c^2+d^2\right )}\\ &=\frac {\left (c^5+5 i c^4 d-10 c^3 d^2-10 i c^2 d^3-35 c d^4+25 i d^5\right ) x}{8 a^3 (c-i d)^2 (c+i d)^5}+\frac {d \left (c^3+5 i c^2 d-11 c d^2+25 i d^3\right )}{8 a^3 (c-i d) (c+i d)^4 f (c+d \tan (e+f x))}-\frac {1}{6 (i c-d) f (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))}+\frac {3 i c-11 d}{24 a (c+i d)^2 f (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))}+\frac {c^2+5 i c d-12 d^2}{8 (i c-d)^3 f \left (a^3+i a^3 \tan (e+f x)\right ) (c+d \tan (e+f x))}-\frac {\left (d^4 (5 i c+3 d)\right ) \int \frac {d-c \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{a^3 (c-i d)^2 (c+i d)^5}\\ &=\frac {\left (c^5+5 i c^4 d-10 c^3 d^2-10 i c^2 d^3-35 c d^4+25 i d^5\right ) x}{8 a^3 (c-i d)^2 (c+i d)^5}-\frac {d^4 (5 i c+3 d) \log (c \cos (e+f x)+d \sin (e+f x))}{a^3 (c-i d)^2 (c+i d)^5 f}+\frac {d \left (c^3+5 i c^2 d-11 c d^2+25 i d^3\right )}{8 a^3 (c-i d) (c+i d)^4 f (c+d \tan (e+f x))}-\frac {1}{6 (i c-d) f (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))}+\frac {3 i c-11 d}{24 a (c+i d)^2 f (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))}+\frac {c^2+5 i c d-12 d^2}{8 (i c-d)^3 f \left (a^3+i a^3 \tan (e+f x)\right ) (c+d \tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 5.22, size = 633, normalized size = 1.77 \begin {gather*} \frac {\sec ^3(e+f x) (\cos (f x)+i \sin (f x))^3 \left (\frac {6 i (c+i d) \left (3 c^2+14 i c d-23 d^2\right ) \cos (2 f x) (\cos (e)+i \sin (e))}{f}+\frac {3 (c+i d)^2 (3 c+7 i d) \cos (4 f x) (i \cos (e)+\sin (e))}{f}+\frac {96 (5 c-3 i d) d^4 \text {ArcTan}\left (\frac {\left (-3 c^2 d+d^3\right ) \cos (f x)-c \left (c^2-3 d^2\right ) \sin (f x)}{c \left (c^2-3 d^2\right ) \cos (f x)+d \left (-3 c^2+d^2\right ) \sin (f x)}\right ) \left (\cos \left (\frac {3 e}{2}\right )+i \sin \left (\frac {3 e}{2}\right )\right )^2}{(c-i d)^2 f}-\frac {48 i (5 c-3 i d) d^4 \log \left ((c \cos (e+f x)+d \sin (e+f x))^2\right ) \left (\cos \left (\frac {3 e}{2}\right )+i \sin \left (\frac {3 e}{2}\right )\right )^2}{(c-i d)^2 f}+\frac {96 (5 c-3 i d) d^4 x (\cos (3 e)+i \sin (3 e))}{(c-i d)^2}+\frac {12 \left (c^5+5 i c^4 d-10 c^3 d^2-10 i c^2 d^3-35 c d^4+25 i d^5\right ) x (\cos (3 e)+i \sin (3 e))}{(c-i d)^2}+\frac {2 (c+i d)^3 \cos (6 f x) (i \cos (3 e)+\sin (3 e))}{f}+\frac {6 (c+i d) \left (3 c^2+14 i c d-23 d^2\right ) (\cos (e)+i \sin (e)) \sin (2 f x)}{f}+\frac {3 (c+i d)^2 (3 c+7 i d) (\cos (e)-i \sin (e)) \sin (4 f x)}{f}+\frac {2 (c+i d)^3 (\cos (3 e)-i \sin (3 e)) \sin (6 f x)}{f}+\frac {96 d^5 (-i c+d) (\cos (3 e)+i \sin (3 e)) \sin (f x)}{(c-i d) f (c \cos (e)+d \sin (e)) (c \cos (e+f x)+d \sin (e+f x))}\right )}{96 (c+i d)^5 (a+i a \tan (e+f x))^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 1.03, size = 298, normalized size = 0.83 Too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.30, size = 609, normalized size = 1.71 \begin {gather*} -\frac {-2 i \, c^{6} + 4 \, c^{5} d - 2 i \, c^{4} d^{2} + 8 \, c^{3} d^{3} + 2 i \, c^{2} d^{4} + 4 \, c d^{5} + 2 i \, d^{6} - 12 \, {\left (c^{6} + 4 i \, c^{5} d - 5 \, c^{4} d^{2} - 85 \, c^{2} d^{4} + 124 i \, c d^{5} + 49 \, d^{6}\right )} f x e^{\left (8 i \, f x + 8 i \, e\right )} - 6 \, {\left (3 i \, c^{6} - 8 \, c^{5} d + 5 i \, c^{4} d^{2} - 40 \, c^{3} d^{3} + 25 i \, c^{2} d^{4} + 55 i \, d^{6} + 2 \, {\left (c^{6} + 6 i \, c^{5} d - 15 \, c^{4} d^{2} - 20 i \, c^{3} d^{3} - 65 \, c^{2} d^{4} - 26 i \, c d^{5} - 49 \, d^{6}\right )} f x\right )} e^{\left (6 i \, f x + 6 i \, e\right )} - 3 \, {\left (9 i \, c^{6} - 32 \, c^{5} d - 21 i \, c^{4} d^{2} - 64 \, c^{3} d^{3} - 69 i \, c^{2} d^{4} - 32 \, c d^{5} - 39 i \, d^{6}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (-11 i \, c^{6} + 30 \, c^{5} d - 3 i \, c^{4} d^{2} + 60 \, c^{3} d^{3} + 27 i \, c^{2} d^{4} + 30 \, c d^{5} + 19 i \, d^{6}\right )} e^{\left (2 i \, f x + 2 i \, e\right )} - 96 \, {\left ({\left (-5 i \, c^{2} d^{4} - 8 \, c d^{5} + 3 i \, d^{6}\right )} e^{\left (8 i \, f x + 8 i \, e\right )} + {\left (-5 i \, c^{2} d^{4} + 2 \, c d^{5} - 3 i \, d^{6}\right )} e^{\left (6 i \, f x + 6 i \, e\right )}\right )} \log \left (\frac {{\left (i \, c + d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + i \, c - d}{i \, c + d}\right )}{96 \, {\left ({\left (a^{3} c^{8} + 2 i \, a^{3} c^{7} d + 2 \, a^{3} c^{6} d^{2} + 6 i \, a^{3} c^{5} d^{3} + 6 i \, a^{3} c^{3} d^{5} - 2 \, a^{3} c^{2} d^{6} + 2 i \, a^{3} c d^{7} - a^{3} d^{8}\right )} f e^{\left (8 i \, f x + 8 i \, e\right )} + {\left (a^{3} c^{8} + 4 i \, a^{3} c^{7} d - 4 \, a^{3} c^{6} d^{2} + 4 i \, a^{3} c^{5} d^{3} - 10 \, a^{3} c^{4} d^{4} - 4 i \, a^{3} c^{3} d^{5} - 4 \, a^{3} c^{2} d^{6} - 4 i \, a^{3} c d^{7} + a^{3} d^{8}\right )} f e^{\left (6 i \, f x + 6 i \, e\right )}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 73.49, size = 1792, normalized size = 5.02 \begin {gather*} \frac {2 d^{5}}{a^{3} c^{7} f + 3 i a^{3} c^{6} d f - a^{3} c^{5} d^{2} f + 5 i a^{3} c^{4} d^{3} f - 5 a^{3} c^{3} d^{4} f + i a^{3} c^{2} d^{5} f - 3 a^{3} c d^{6} f - i a^{3} d^{7} f + \left (a^{3} c^{7} f e^{2 i e} + i a^{3} c^{6} d f e^{2 i e} + 3 a^{3} c^{5} d^{2} f e^{2 i e} + 3 i a^{3} c^{4} d^{3} f e^{2 i e} + 3 a^{3} c^{3} d^{4} f e^{2 i e} + 3 i a^{3} c^{2} d^{5} f e^{2 i e} + a^{3} c d^{6} f e^{2 i e} + i a^{3} d^{7} f e^{2 i e}\right ) e^{2 i f x}} + \frac {x \left (c^{3} + 7 i c^{2} d - 23 c d^{2} - 49 i d^{3}\right )}{8 a^{3} c^{5} + 40 i a^{3} c^{4} d - 80 a^{3} c^{3} d^{2} - 80 i a^{3} c^{2} d^{3} + 40 a^{3} c d^{4} + 8 i a^{3} d^{5}} + \begin {cases} \frac {\left (512 i a^{6} c^{7} f^{2} e^{6 i e} - 3584 a^{6} c^{6} d f^{2} e^{6 i e} - 10752 i a^{6} c^{5} d^{2} f^{2} e^{6 i e} + 17920 a^{6} c^{4} d^{3} f^{2} e^{6 i e} + 17920 i a^{6} c^{3} d^{4} f^{2} e^{6 i e} - 10752 a^{6} c^{2} d^{5} f^{2} e^{6 i e} - 3584 i a^{6} c d^{6} f^{2} e^{6 i e} + 512 a^{6} d^{7} f^{2} e^{6 i e}\right ) e^{- 6 i f x} + \left (2304 i a^{6} c^{7} f^{2} e^{8 i e} - 19200 a^{6} c^{6} d f^{2} e^{8 i e} - 66816 i a^{6} c^{5} d^{2} f^{2} e^{8 i e} + 126720 a^{6} c^{4} d^{3} f^{2} e^{8 i e} + 142080 i a^{6} c^{3} d^{4} f^{2} e^{8 i e} - 94464 a^{6} c^{2} d^{5} f^{2} e^{8 i e} - 34560 i a^{6} c d^{6} f^{2} e^{8 i e} + 5376 a^{6} d^{7} f^{2} e^{8 i e}\right ) e^{- 4 i f x} + \left (4608 i a^{6} c^{7} f^{2} e^{10 i e} - 44544 a^{6} c^{6} d f^{2} e^{10 i e} - 188928 i a^{6} c^{5} d^{2} f^{2} e^{10 i e} + 437760 a^{6} c^{4} d^{3} f^{2} e^{10 i e} + 591360 i a^{6} c^{3} d^{4} f^{2} e^{10 i e} - 465408 a^{6} c^{2} d^{5} f^{2} e^{10 i e} - 198144 i a^{6} c d^{6} f^{2} e^{10 i e} + 35328 a^{6} d^{7} f^{2} e^{10 i e}\right ) e^{- 2 i f x}}{24576 a^{9} c^{9} f^{3} e^{12 i e} + 221184 i a^{9} c^{8} d f^{3} e^{12 i e} - 884736 a^{9} c^{7} d^{2} f^{3} e^{12 i e} - 2064384 i a^{9} c^{6} d^{3} f^{3} e^{12 i e} + 3096576 a^{9} c^{5} d^{4} f^{3} e^{12 i e} + 3096576 i a^{9} c^{4} d^{5} f^{3} e^{12 i e} - 2064384 a^{9} c^{3} d^{6} f^{3} e^{12 i e} - 884736 i a^{9} c^{2} d^{7} f^{3} e^{12 i e} + 221184 a^{9} c d^{8} f^{3} e^{12 i e} + 24576 i a^{9} d^{9} f^{3} e^{12 i e}} & \text {for}\: 24576 a^{9} c^{9} f^{3} e^{12 i e} + 221184 i a^{9} c^{8} d f^{3} e^{12 i e} - 884736 a^{9} c^{7} d^{2} f^{3} e^{12 i e} - 2064384 i a^{9} c^{6} d^{3} f^{3} e^{12 i e} + 3096576 a^{9} c^{5} d^{4} f^{3} e^{12 i e} + 3096576 i a^{9} c^{4} d^{5} f^{3} e^{12 i e} - 2064384 a^{9} c^{3} d^{6} f^{3} e^{12 i e} - 884736 i a^{9} c^{2} d^{7} f^{3} e^{12 i e} + 221184 a^{9} c d^{8} f^{3} e^{12 i e} + 24576 i a^{9} d^{9} f^{3} e^{12 i e} \neq 0 \\x \left (- \frac {c^{3} + 7 i c^{2} d - 23 c d^{2} - 49 i d^{3}}{8 a^{3} c^{5} + 40 i a^{3} c^{4} d - 80 a^{3} c^{3} d^{2} - 80 i a^{3} c^{2} d^{3} + 40 a^{3} c d^{4} + 8 i a^{3} d^{5}} + \frac {c^{3} e^{6 i e} + 3 c^{3} e^{4 i e} + 3 c^{3} e^{2 i e} + c^{3} + 7 i c^{2} d e^{6 i e} + 17 i c^{2} d e^{4 i e} + 13 i c^{2} d e^{2 i e} + 3 i c^{2} d - 23 c d^{2} e^{6 i e} - 37 c d^{2} e^{4 i e} - 17 c d^{2} e^{2 i e} - 3 c d^{2} - 49 i d^{3} e^{6 i e} - 23 i d^{3} e^{4 i e} - 7 i d^{3} e^{2 i e} - i d^{3}}{8 a^{3} c^{5} e^{6 i e} + 40 i a^{3} c^{4} d e^{6 i e} - 80 a^{3} c^{3} d^{2} e^{6 i e} - 80 i a^{3} c^{2} d^{3} e^{6 i e} + 40 a^{3} c d^{4} e^{6 i e} + 8 i a^{3} d^{5} e^{6 i e}}\right ) & \text {otherwise} \end {cases} - \frac {i d^{4} \cdot \left (5 c - 3 i d\right ) \log {\left (\frac {c + i d}{c e^{2 i e} - i d e^{2 i e}} + e^{2 i f x} \right )}}{a^{3} f \left (c - i d\right )^{2} \left (c + i d\right )^{5}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 648 vs. \(2 (316) = 632\).
time = 0.83, size = 648, normalized size = 1.82 \begin {gather*} -\frac {2 \, {\left (\frac {{\left (5 \, c d^{5} - 3 i \, d^{6}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{-2 i \, a^{3} c^{7} d + 6 \, a^{3} c^{6} d^{2} + 2 i \, a^{3} c^{5} d^{3} + 10 \, a^{3} c^{4} d^{4} + 10 i \, a^{3} c^{3} d^{5} + 2 \, a^{3} c^{2} d^{6} + 6 i \, a^{3} c d^{7} - 2 \, a^{3} d^{8}} - \frac {{\left (c^{3} + 7 i \, c^{2} d - 23 \, c d^{2} - 49 i \, d^{3}\right )} \log \left (i \, \tan \left (f x + e\right ) + 1\right )}{32 i \, a^{3} c^{5} - 160 \, a^{3} c^{4} d - 320 i \, a^{3} c^{3} d^{2} + 320 \, a^{3} c^{2} d^{3} + 160 i \, a^{3} c d^{4} - 32 \, a^{3} d^{5}} - \frac {\log \left (-i \, \tan \left (f x + e\right ) + 1\right )}{-32 i \, a^{3} c^{2} - 64 \, a^{3} c d + 32 i \, a^{3} d^{2}} - \frac {5 \, c d^{5} \tan \left (f x + e\right ) - 3 i \, d^{6} \tan \left (f x + e\right ) + 6 \, c^{2} d^{4} - 3 i \, c d^{5} + d^{6}}{-2 \, {\left (i \, a^{3} c^{7} - 3 \, a^{3} c^{6} d - i \, a^{3} c^{5} d^{2} - 5 \, a^{3} c^{4} d^{3} - 5 i \, a^{3} c^{3} d^{4} - a^{3} c^{2} d^{5} - 3 i \, a^{3} c d^{6} + a^{3} d^{7}\right )} {\left (d \tan \left (f x + e\right ) + c\right )}} + \frac {11 \, c^{3} \tan \left (f x + e\right )^{3} + 77 i \, c^{2} d \tan \left (f x + e\right )^{3} - 253 \, c d^{2} \tan \left (f x + e\right )^{3} - 539 i \, d^{3} \tan \left (f x + e\right )^{3} - 45 i \, c^{3} \tan \left (f x + e\right )^{2} + 315 \, c^{2} d \tan \left (f x + e\right )^{2} + 1035 i \, c d^{2} \tan \left (f x + e\right )^{2} - 1821 \, d^{3} \tan \left (f x + e\right )^{2} - 69 \, c^{3} \tan \left (f x + e\right ) - 483 i \, c^{2} d \tan \left (f x + e\right ) + 1443 \, c d^{2} \tan \left (f x + e\right ) + 2085 i \, d^{3} \tan \left (f x + e\right ) + 51 i \, c^{3} - 293 \, c^{2} d - 709 i \, c d^{2} + 819 \, d^{3}}{-192 \, {\left (-i \, a^{3} c^{5} + 5 \, a^{3} c^{4} d + 10 i \, a^{3} c^{3} d^{2} - 10 \, a^{3} c^{2} d^{3} - 5 i \, a^{3} c d^{4} + a^{3} d^{5}\right )} {\left (\tan \left (f x + e\right ) - i\right )}^{3}}\right )}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 11.67, size = 2653, normalized size = 7.43 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________